<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="/lib/template-web.js"></script>
<script src="/layui/layui.js"></script>
<script src="/lib/jquery.js"></script>
<script src="/js/dishes.js"></script>

<body>
    <!-- <div class="dishes-container">
        菜品管理
    </div> -->
    <div class="layui-card ">
        <div class="layui-card-body disher-body">
            <!-- 筛选区域 -->
            <div class="layui-form" id="form-search">
                <div class="layui-form-item layui-inline spj_header">

                    <input type="text" placeholder="请输入菜品名称" class="layui-input search">
                    <div class="zhanweifu"></div>
                    <div class="batch">
                        <span class="batchRemove">批量删除</span>
                        <span style="color: blue;" class="batchEdit">批量启售</span>
                        <span style="color:red;" class="batchEdits">批量停售</span>
                        <button class="layui-btn layui-btn-warm addCate" style="margin-left: 20px;">+新建菜品</button>
                    </div>
                </div>
            </div>
            <!-- 列表区域 -->
            <table class="layui-table" lay-even lay-skin="nob" align="center">
                <colgroup>
                    <col />
                    <col width="220" />
                    <col width="180" />
                    <col width="190" />
                    <col width="190" />
                    <col width="190" />
                    <col width="300" />
                    <col width="" />

                </colgroup>
                <thead>
                    <tr>
                        <th><input type="checkbox" name="" title=""
                                class="layui-form-checkbox checkall"><strong>菜品名称</strong></th>
                        <th><strong>图片</strong></th>
                        <th><strong>菜品分类</strong></th>
                        <th><strong>售价</strong></th>
                        <th><strong>售卖状态</strong></th>
                        <th><strong>最后操作时间</strong></th>
                        <th style="text-align: center;"><strong>操作</strong></th>
                    </tr>
                </thead>
                <tbody>



                </tbody>
            </table>
            <div id="pageBox"></div>

        </div>

    </div>
    <script>
        layui.use('form', function () { //此段代码必不可少
            var form = layui.form;
            form.render();
        });
        $('.addCate').on('click', function () {
            location.href = '/index.html#/add'
            window.location.reload();
        })
        $('tbody').on('click', '.btnUpdate', function () {
            location.href = '/index.html#/updateDishes' //http://127.0.0.1:5500/index.html#/add
            window.location.reload();
        })
    </script>

    <script type="text/html" id="tpl">
        {{each records}}
        <tr>
            <td><input type="checkbox" name="" title="" class="layui-form-checkbox j-checkbox" data-id={{$value.id}} data-status="{{$value.status}}">{{$value.name}}</td>
            <td><img src="http://121.4.102.44:8083/common/download?name={{$value.image}}" alt="" style="width: 40px; height:40px;
    border-radius: 5px;"></td>
            <td class="niuma">{{$value.categoryName}}</td>
            <td>￥{{$value.price/100}}</td>
            <td>{{$value.status==0?'停售': '启售'}}</td>
            <td>{{$value.updateTime}}</td>
            <td class="JSa" style="text-align: center;">
                <a type="button" class="blueBug  btnUpdate" data-id={{$value.id}}>修改</a>&nbsp;&nbsp;&nbsp;
                <a type="button" class="blueBug btnEdit" data-status="{{$value.status}}" data-id={{$value.id}}>{{$value.status==0?'启售':'停售'}}</a>&nbsp;&nbsp;&nbsp;
                <a type="button" class="delBut btnDel" data-status="{{$value.status}}" data-id={{$value.id}}>删除</a>
            </td>
        </tr>
        {{/each}}
    </script>
    <!-- 分页区域 -->

</body>

</html>